package com.lcz.cloud_note.controller;

import com.lcz.cloud_note.service.IActionService;
import com.lcz.cloud_note.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/action")
public class ActionController
{
    @Autowired
    IActionService actionService;

    @RequestMapping("list.do")
    public Result listAction()
    {
        return actionService.listAction();
    }


    /**
     * 查看某个分类参加活动笔记
     */
    @RequestMapping("listActionDetail.do")
    public Result listActionDetail(String actionId,int page)
    {
        return actionService.listActionDetail(actionId,page);
    }
    /**
     * 参加活动笔记
     */
    @RequestMapping("add.do")
    public Result addAction(String actionId,String noteId)
    {
        return actionService.addAction(actionId,noteId);
    }
    /**
     * 显示活动笔记
     */
    @RequestMapping("showActionDetail.do")
    public Result showActionDetail(String actionDetailId)
    {
        return actionService.showActionDetail(actionDetailId);
    }
    /**
     * 点赞活动笔记
     */
    @RequestMapping("upActionDetail.do")
    public Result upActionDetail(String userId,String actionDetailId)
    {
        return actionService.upActionDetail(userId,actionDetailId);
    }
    /**
     * 点踩活动笔记
     */
    @RequestMapping("downActionDetail.do")
    public Result downActionDetail(String userId,String actionDetailId)
    {
        return actionService.downActionDetail(userId,actionDetailId);
    }

    /**
     * 查询自己的参与活动的笔记
     */
    @RequestMapping("actionDetailByUser.do")
    public Result actionDetailByUser(String userId)
    {
        return actionService.actionDetailByUser(userId);
    }


    /**
     * 显示活动笔记
     */
    @RequestMapping("showActionDetailByNoteId.do")
    public Result showActionDetailByNoteId(String noteId)
    {
        return actionService.showActionDetailByNoteId(noteId);
    }
}
